In the field of computer graphics, the graphics rendering pipeline is the core of real time graphics. The function of the pipeline is to generate, or render, two dimensional images, three dimensional objects, light sources, lighting models, textures and more. The locations and shapes of the objects in the scene are determined by the geometry, placement of the camera in the environment and the characteristics of that environment. The appearance of the objects is affected by material properties, light sources, textures and lighting models.
The process of rasterizing in computer graphics defines a particular scene in terms of primitives, which are typically triangles. For a particular scene, the area to be displayed by a computer system is termed a screen region. The screen region usually is an area that is less than the total scene. Therefore, some of the primitives lie outside of the screen region, while others lie either partially in the screen region or completely within the screen region. During rasterization the primitives are processed such that pixels contained within the primitives are given values in terms of their color, textures, transparency, etc.
Initially during rasterization, the primitives are filled with a solid color or pattern. The function of filling primitives can be broken into two parts. First a decision must be made as to which pixels to “fill” (assign values) within a primitive, and also as to what values to assign to these pixels. If the pixels are to be assigned a solid color, for example, then primitives which lie entirely within the screen region have each of their pixels assigned the color value. However, if a primitive lies only partially within the screen area, to assign all the pixels a particular value and then to discard the portion of the primitive lying outside of the screen area requires large amounts of computer processing time and is inefficient.
The process of clipping is the process of determining the portion of a primitive that is within a clipping region, such as the screen region. By clipping the rectangle to the screen region drawing time is saved during the rasterization. Scissoring is the process of computing all points of the primitive, and then drawing only those lines within in the rasterized clip region. Although a number of algorithms are set forth in the prior art with regards to scissoring and clipping, increasing complexity of graphic images has required more efficient methods of clipping or scissoring primitives with regards to the screen region.
Therefore, there is a need in the prior art to provide a more efficient method and apparatus for culling pixels of a primitive that are not in a scissors region. A drawback of the prior art is an implementation of scissoring primitives which fills all the primitives with pixels and then for every pixel has hardware check x,y pixel coordinates against the scissor planes and cull each pixel individually if it is outside the scissor plane. This prior art method is very inefficient in terms of performance as it requires hardware to completely fill all primitives, even for pixels that are outside the scissor plane. Another prior art method is to perform clipping at intersections of primitive edges with the scissor plane. New primitives are then created by subdividing the original primitives in an interactive manner until there are no primitives to intersect the scissor plane. This prior art method of clipping is slow and costly in terms of hardware implementations.